package org.mx.service.rest.graphql;

import java.util.ArrayList;
import java.util.List;

import lombok.Getter;

/**
 * 描述： 用户自定义的GraphQL执行器组类定义
 *
 * @author john peng Date time 2018/10/4 下午2:03
 */
@Getter
public class GraphQLTypeExecution {
	private String typeName = null;
	private List<GraphQLField> executions = null;

	private GraphQLTypeExecution() {
		super();
		this.executions = new ArrayList<>();
	}

	/**
	 * 构造函数
	 * 
	 * @param typeName 类型名
	 */
	public GraphQLTypeExecution(String typeName) {
		this();
		this.typeName = typeName;
	}

	/**
	 * 构造函数
	 * 
	 * @param execution 执行器
	 * @return GraphQLTypeExecution
	 */
	public GraphQLTypeExecution addExecution(GraphQLField execution) {
		executions.add(execution);
		return this;
	}
}
